package com.example.tilitili.controller;

import com.example.tilitili.service.IGoodsService;
import com.example.tilitili.service.ISeckillGoodsService;
import com.example.tilitili.vo.GoodsVo;
import com.example.tilitili.vo.RespBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

@Controller
@RequestMapping("/grounding")
@Slf4j
public class GroundingController {
    @Autowired
    private IGoodsService goodsService;

    /*
     *跳转上架界面
     */
    @RequestMapping("/togrounding")
    public String togrounding(){
        return "grounding";
    }

    /*
     *上架功能
     */
    @RequestMapping("/dogrounding")
    @ResponseBody
    public RespBean dogrounding(@Valid GoodsVo goodsVo, HttpServletRequest request, HttpServletResponse response){
//        log.info("{}",goodsVo);
//        return null;
        return goodsService.dogrounding(goodsVo,request,response);
    }


}
